from django.conf.urls import url
from . import views
# 自动生成视图集路由
from rest_framework.routers import DefaultRouter

# JWT提供了登录签发JWT的视图，可以直接使用,返回值仅有token
from rest_framework_jwt.views import obtain_jwt_token
from .views import total_count,userView,specs

urlpatterns = [
    # 匹配jwt提供的方法,实现登陆功能
    url(r'^authorizations/$', obtain_jwt_token),

# -------用户总量统计
    url(r'^statistical/total_count/$', total_count.UserTotalCountView.as_view()),
 # -------日增用户统计
    url(r'^statistical/day_increment/$', total_count.UserDayCountView.as_view()),

# -----------日活跃用户统计
    url(r'^statistical/day_active/$', total_count.UserActiveCountView.as_view()),

# -----------日活下单，关联查询
    url(r'^statistical/day_orders/$', total_count.UserOrderCountView.as_view()),

# -----前三十天增加的用户，
    #
      url(r'^statistical/month_increment/$', total_count.UserMonthCountView.as_view()),


# 日分类商品访问量
    url(r'^statistical/goods_day_views/$', total_count.GoodsDayView.as_view()),

# 用户的查询获取用户的查询获取

    url (r'^users/$', userView.UserView.as_view ()),

    # 获取新增规格下拉类表

    url (r'^goods/simple/$', specs.specsView.as_view ({"get":"simple"})),

]

# 规格表路由
roter=DefaultRouter()
roter.register("goods/specs",specs.specsView,base_name="specs")
print(roter.urls)
urlpatterns+=roter.urls



